//
// Created by zhangJA on 2020/6/26.
//判断11~999之间的数m是否为回文,满足m m^2 m^3均为回文（回文=各位数字左右对称的整数;  比如11^2=121,11^3=1331）

#include <iostream>
using namespace std;
bool sym(unsigned n);
//主函数
int main()
{
    for(unsigned m=11;m<1000;m++)
        if(sym(m) && sym(m*m) && sym(m*m*m))
        {
            cout<<"m="<<m<<" ";
            cout<<"m^2="<<m*m<<" ";
            cout<<"m^3="<<m*m*m<<endl;
        }
    return 0;
}
//自制函数：判断n是否为回文数
bool sym(unsigned n)
{
    unsigned i=n;
    unsigned m=0;
    while (i>0)
    {
        m=m*10+i%10;
        i/=10;
    }
    return m==n;
}
